#include <opencv2/opencv.hpp>
#include <time.h>
#include <iostream>
 
int main(int argc, char** argv)
{
  //write a yaml file
  cv::FileStorage fs_write("./test.yaml", cv::FileStorage::WRITE);
 
  time_t rawtime;
  time(&rawtime);
  fs_write << "Time" << asctime(localtime(&rawtime));
  
  std::vector<int> image_size = {1280, 800};
  fs_write << "imageSize" << image_size; 
 
  cv::Mat camera_matrix = (cv::Mat_<double>(3, 3) << 190, 0, 640, 
                                                     0, 190, 400, 
                                                     0, 0, 1);
  cv::Mat distort_coefficient = (cv::Mat_<double>(5, 1) << 0.1, 0.01, -0.001, 0, 0);
  fs_write << "cameraMatrix" << camera_matrix << "distCoeffs" << distort_coefficient;
    
  fs_write.release();
 
  return 0;
}